package com.company;

import org.junit.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TaxiChargingTest_HJQ {

    // 测试在8公里以内的里程数
    @Test
    public void test_calculateFare_within8km() {
        double price = TaxiCharging_HJQ.calculateFare(8, 0);
        assertEquals(6.4, price, 0.001);
    }

    // 测试超过8公里的里程数
    @Test
    public void test_calculateFare_over8km() {
        double price = TaxiCharging_HJQ.calculateFare(9, 0);
        assertEquals(7.05, price, 0.001);
    }

    // 测试包含等待费的里程数
    @Test
    public void test_calculateFare_withWaiting() {
        double price = TaxiCharging_HJQ.calculateFare(5, 5);
        assertEquals(4.25, price, 0.001);
    }
}
